<!DOCTYPE html>
<html lang="cn-zh">

<head>
  
  <meta charset="utf-8">



<meta name="viewport" content="width=device-width, initial-scale=1.0">


  <meta name="description" content="hugo配置基础使用功能">


<meta name="color-scheme" content="light dark">







<meta name="generator" content="Hugo 0.111.2">

<meta content="hugo, 博客搭建指南, hugo-flex" name="keywords">
<meta content="使用hugo配置博客文档 - 通通不同-博客" property="og:title">
<meta content="开发的乐趣在于相通而不同 - hugo配置基础使用功能" property="og:description">

<meta name="msvalidate.01" content="F56ED94B7E86941E3DACEF208F07D329" />

  <title>
    
    使用hugo配置博客文档
     - 通通不同-博客
    
</title>

  <link rel="canonical" href="https://codebeautiful.gitee.io/post/config/">


  








  
    
  
  
  <link rel="stylesheet" href="/css/base.min.4f231885947d13c748c815d93da49f07ab89afb67629f9970b7c054610e88e0b.css" integrity="sha256-TyMYhZR9E8dIyBXZPaSfB6uJr7Z2KfmXC3wFRhDojgs=" crossorigin="anonymous">



</head>

<body>
  <nav class="u-background">
  <div class="u-wrapper">
    <ul class="Banner">
      <li class="Banner-item Banner-item--title">
        <h1 class="Banner-heading">
          <a class="Banner-link u-clickable" href="/">通通不同-博客</a>
        </h1>
      </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/post/">全部</a>
        </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/categories/">分类</a>
        </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/tags/">标签</a>
        </li>
      
        <li class="Banner-item">
          <a class="Banner-link u-clickable" href="/about/">关于</a>
        </li>
      
    </ul>
  </div>
</nav>

  <main>
    <div class="u-wrapper">
      <div class="u-padding">
        

  <article>
    <header class="Heading">
  <h2 class="Heading-title">
    <a class="Heading-link u-clickable" href="/post/config/" rel="bookmark">使用hugo配置博客文档</a>
  </h2>
  
    <time datetime="2023-03-11T23:16:37&#43;08:00">11 March, 2023</time>
  
</header>

    <h3 id="安装">
  <a class="Heading-link u-clickable" href="/post/config/#%e5%ae%89%e8%a3%85">安装</a>
</h3>

<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ brew install hugo</span></span></code></pre></div>
<h3 id="生成博客">
  <a class="Heading-link u-clickable" href="/post/config/#%e7%94%9f%e6%88%90%e5%8d%9a%e5%ae%a2">生成博客</a>
</h3>

<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ hugo new site myblog</span></span></code></pre></div>
<h3 id="安装皮肤">
  <a class="Heading-link u-clickable" href="/post/config/#%e5%ae%89%e8%a3%85%e7%9a%ae%e8%82%a4">安装皮肤</a>
</h3>

<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ cd themes
</span></span><span style="display:flex;"><span>$ git clone https://github.com/de-souza/hugo-flex.git</span></span></code></pre></div>
<h3 id="创建文章">
  <a class="Heading-link u-clickable" href="/post/config/#%e5%88%9b%e5%bb%ba%e6%96%87%e7%ab%a0">创建文章</a>
</h3>

<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>$ hugo new post/config.md</span></span></code></pre></div>
<h3 id="运行hugo">
  <a class="Heading-link u-clickable" href="/post/config/#%e8%bf%90%e8%a1%8chugo">运行hugo</a>
</h3>

<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>hugo server -D --theme<span style="color:#f92672">=</span>hugo-flex --buildDrafts</span></span></code></pre></div>
<h3 id="部署">
  <a class="Heading-link u-clickable" href="/post/config/#%e9%83%a8%e7%bd%b2">部署</a>
</h3>

<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>hugo --theme<span style="color:#f92672">=</span>hugo-flex --baseUrl<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://blog.ttbt.work&#34;</span> --buildDrafts
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>hugo --theme<span style="color:#f92672">=</span>hugo-flex --baseUrl<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://codebeautiful.gitee.io&#34;</span> --buildDrafts</span></span></code></pre></div>

    


  

  

  





  <footer>
    
      
    
      
    
      
        <ul class="Tags">
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/hugo/" rel="tag">hugo</a>
            </li>
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA%E6%8C%87%E5%8D%97/" rel="tag">博客搭建指南</a>
            </li>
          
            <li class="Tags-item u-background">
              <a class="Tags-link u-clickable" href="/tags/hugo-flex/" rel="tag">hugo-flex</a>
            </li>
          
        </ul>
      
    
  </footer>

    
  

  </article>


      </div>
    </div>
  </main>
  
  <footer class="Footer">
    <div class="u-wrapper">
      <div class="u-padding">
        开发的乐趣在于相通而不同
      </div>
    </div>
  </footer>


  <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?d08a2ad355cb7a065a41be081b43297e";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>

</body>

</html>
